package com.ald.crossex.dto.wechat;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by lishijiong on 15/3/11.
 */
public class PublishJourneyRequest extends BaseRequest {

    private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    private int uid;
    private int type;
    private String start;
    private String end;
    private int startProvinceId;
    private int startCityId;
    private int startZoneId;
    private int endProvinceId;
    private int endCityId;
    private int endZoneId;

    private String startTimeStr;
    private Date startTime;
    private String endTimeStr;
    private Date endTime;
    private String phone;
    private int trafficType;
    private float fee;
    private String remark;


    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getStart() {
        return start;
    }

    public void setStart(String start) {
        this.start = start;
    }

    public String getEnd() {
        return end;
    }

    public void setEnd(String end) {
        this.end = end;
    }

    public int getStartProvinceId() {
        return startProvinceId;
    }

    public void setStartProvinceId(int startProvinceId) {
        this.startProvinceId = startProvinceId;
    }

    public int getStartCityId() {
        return startCityId;
    }

    public void setStartCityId(int startCityId) {
        this.startCityId = startCityId;
    }

    public int getStartZoneId() {
        return startZoneId;
    }

    public void setStartZoneId(int startZoneId) {
        this.startZoneId = startZoneId;
    }

    public int getEndProvinceId() {
        return endProvinceId;
    }

    public void setEndProvinceId(int endProvinceId) {
        this.endProvinceId = endProvinceId;
    }

    public int getEndCityId() {
        return endCityId;
    }

    public void setEndCityId(int endCityId) {
        this.endCityId = endCityId;
    }

    public int getEndZoneId() {
        return endZoneId;
    }

    public void setEndZoneId(int endZoneId) {
        this.endZoneId = endZoneId;
    }

    public Date getStartTime() {

        String[] s = startTimeStr.split("T");
        //2015-02-27T12:00
        String d = s[0]+" "+s[1]+":00";
        try {
            Date date = format.parse(d);
            return date;
        } catch (ParseException e) {
            e.printStackTrace();
            return new Date();
        }
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        String[] s = endTimeStr.split("T");
        //2015-02-27T12:00
        String d = s[0]+" "+s[1]+":00";
        try {
            Date date = format.parse(d);
            return date;
        } catch (ParseException e) {
            e.printStackTrace();
            return new Date();
        }
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public int getTrafficType() {
        return trafficType;
    }

    public void setTrafficType(int trafficType) {
        this.trafficType = trafficType;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public float getFee() {
        return fee;
    }

    public void setFee(float fee) {
        this.fee = fee;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getStartTimeStr() {
        return startTimeStr;
    }

    public void setStartTimeStr(String startTimeStr) {
        this.startTimeStr = startTimeStr;
    }

    public String getEndTimeStr() {
        return endTimeStr;
    }

    public void setEndTimeStr(String endTimeStr) {
        this.endTimeStr = endTimeStr;
    }
}
